<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>关于数据传递问题</title>
</head>
<body>
<!-- 
    问题：在 js 调用函数时传递变量参数时，是值传递还是引用传递
        理解 1：都是值(基本/地址值)传递
        理解 2：可能是值传递，也可能是引用传递(地址值)
 -->
<script type="text/javascript">
    var a = 3
    function fn(a){
        a = a+1
    }
    fn(a)
    console.log(a)
    function fn2(obj){
        console.log(obj.name)
    }
    var obj = {name:'Tom'}
    fn2(obj)
</script>
</body>
</html>